package java_abstraction.instance_of.bad;

public class BadInstanceOf {

	public static void main(String[] args) {
		move(new Fish());
		move(new Spider());
	}

	public static void move(Animal aAnimal) {
		if (aAnimal instanceof Fish) {
			Fish fish = (Fish) aAnimal;
			fish.swim();
		} else if (aAnimal instanceof Spider) {
			Spider spider = (Spider) aAnimal;
			spider.crawl();
		}
	}
}
